home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / news / moderating / mod.procmail.Z / mod.procmail / text0000.txt < prev   
Encoding:
Text File  |  1994-05-06  |  3.2 KB  |  114 lines

  1.  
  2. Kent,
  3.  
  4. This is intended for anyone having access to procmail.
  5. Feel free to archive or ignore or whatever. :-)
  6.  
  7. Sridhar.
  8. -------
  9. # Using Procmail to moderate a Usenet group. 
  10. # .procmailrc
  11. # by Sridhar Venkataraman <sridhar@asuvax.eas.asu.edu>
  12. # for rec.food.veg.cooking.
  13. # Short guide to conditions in recipes...
  14. # c - continue
  15. # f - consider the pipe as filter
  16. # h - Feed the header to pipe.
  17. # A - depends on last successful recipe.
  18.  
  19.  
  20. # This recipe converts any mail submissions to the moderation address to appear
  21. # like posting submissions.
  22.  
  23. :cf
  24. ^TOrfvc-mod@utcc.utoronto.ca
  25. | formail -I "To: rec-food-veg-cooking@uunet.uu.net" -a "Newsgroups: rec.food.veg.cooking"
  26.  
  27. # The following recipe recognized the submissions which are sent by
  28. # the psuedo-user news.  In this case, the complete posting appears
  29. # just after the header. Hence the header is chopped.
  30.  
  31. :0cf
  32. * ^From:.*news@
  33. * ^TO.*rec-food-veg-cooking@
  34. | sed -n '2,/^Path:/\!p' | formail -a "To: rec-food-veg-cooking@"
  35.  
  36.  
  37. # This is the start of the recipe cluster that recognizes a submission
  38. # to rec.food.veg.cooking.  Saves a copy in the folder rfvc.
  39.  
  40. :c
  41. ^TOrec-food-veg-cooking@
  42. rfvc
  43.  
  44. # Save the Newsgroups, Subject, From, Date in some variables.
  45.  
  46.     :Ach
  47.     newsgroups=|formail -a "Newsgroups: rec.food.veg.cooking" \
  48.                 -x "Newsgroups:"
  49.     :Ach
  50.     subject=|formail -x "Subject:"
  51.     :Ach
  52.     date=|formail -x "Date:"
  53.     :Ach
  54.     from=|formail -x "From:"
  55.     :Ach
  56.     replyto=|formail -rtx "To:"
  57.  
  58. # If the poster doesn't want autoreplies, he supplies a keyword of
  59. # ignore in the posting. The following recipe appends the poster's
  60. # address to the file $HOME/system/rfvc.
  61.  
  62.     :0 Ach:rfvc.lock
  63.     * Keywords:.*ignore
  64.     | (cat > /dev/null ; echo "$replyto" >> $HOME/system/rfvc)
  65.  
  66. # If the poster doesn't appear in the above file, he/she gets an
  67. # autoreply. This way I have been able to fix several machines'
  68. # reply-able addresses. Also people don't wonder why they don't see
  69. # the posting immediately on moderated groups.
  70.  
  71.     :0 Ach:rfvc.lock
  72.     * !?grep -i $replyto $HOME/system/rfvc
  73.     | (formail -rt -I "Subject: Acknowledgement [l/m 94/03/02]" -i "Received:" \
  74.     -I "From: rfvc submissions <rfvc-request@utcc.utoronto.ca>" ; \
  75.     echo "From:\t\t$from\nDate:\t$date\nNewsgroups:\t$newsgroups\nSubject:\t$subject" ; \
  76.     cat /usr/people/sridhar/misc/rfvc/rec )| $SENDMAIL -t -oi 
  77.  
  78. # Finally the unnecessary headers are ripped off and the bare
  79. # essentials (headers + body) are saved as a MH-style folder. Each
  80. # posting is saved as a file. You can peruse the postings, make any
  81. # changes if need be and use "inews -h < <file>" to post any file.
  82.  
  83.  
  84.     :Acf
  85.     | formail -I "Apparently-To:" -I "To:" -I "Date:" \
  86.           -a "Newsgroups: rec.food.veg.cooking" \
  87.       -I "Sender:"\
  88.       -I "Path:"\
  89.       -a "Organization: -" \
  90.       -a "Archive-Name: " \
  91.       -a "Followup-To: " \
  92.           -I "Lines:" \
  93.           -I "In-Reply-To:" \
  94.       -I "Approved: sridhar@asuvax.eas.asu.edu" \
  95.       -I "X-Newsreader:" \
  96.       -I "Nntp-Posting-Host:" -I "Originator:" \
  97.           -I "Received:" -I "Return-Path:" |  tail +2 
  98.  
  99.     :Ac
  100.     $HOME/misc/rfvc/misc/.
  101.  
  102. # Just to get a copy of headers for quick overview. 
  103.  
  104.     :Ah
  105.     /usr/mail/sridhar
  106.  
  107. # In case of questions on procmail refer the appropriate manual pages.
  108. # In case of any specific questions on the above recipes, you can get
  109. # hold of me - Sridhar <sridhar@asuvax.eas.asu.edu>
  110.  
  111.  
  112.  
  113.  
  114.